export const VxeTableMixin = {
  props: {},
  data() {
    return {
      tablePage: {
        currentPage: 1,
        pageSize: 10,
        totalResult: 0,
        pageSizes: [10, 20, 50, 100, 200, 500],
        layouts: ['PrevPage', 'JumpNumber', 'NextPage', 'Sizes', 'Total'],
      },
    }
  },
  created() {
  },
  methods: {
    async handlePageChange({currentPage, pageSize}) {
      this.tablePage.currentPage = currentPage
      this.tablePage.pageSize = pageSize
      await this.loadList();
    },
    getPageQuery() {
      const param = {}
      param.pageNo = this.tablePage.currentPage
      param.pageSize = this.tablePage.pageSize
      return param;
    },
    setPageTotal(res) {
      this.tablePage.totalResult = res.result.total
      this.tablePage.currentPage = res.result.current
    }
  },
}
